import { defHttp } from '../http'
import type { CommonAPI } from '../model/_utils'

// 获取配置信息
export const configInfoApi: CommonAPI<'/v1/system_config', 'get'> = params =>
  defHttp.get('/system_config', { params })

// 修改配置信息
export const editConfigApi: CommonAPI<'/v1/system_config', 'put'> = data =>
  defHttp.put('/system_config', { data })

// 上传
export const upload: CommonAPI<'/v1/upload', 'post'> = (data: FormData) =>
  defHttp.post('/upload', { data })

export const websiteConfigApi: CommonAPI<
  '/v1/system_config/support',
  'get'
> = () => defHttp.get('/system_config/support')

export const emailTestApi: CommonAPI<
  '/v1/system_config/email_test',
  'post'
> = data => defHttp.post('/system_config/email_test', { data })
